﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WpfApplication1.DBLayer
{
   public class BankTellerDB
    {
        public static int userId;
        public BankEntities db = new BankEntities();
        public BankTeller user = new BankTeller();
        public BankAccount account = new BankAccount();
        //public BankAccountDB accountDB = new BankAccountDB();
        public bool Login_Query(string name, string password)
        {
            bool exist;
            var query = MainWindow.db.BankTellers.Where(acc => acc.Username == name && acc.Password == password).ToList();
            user = query.ElementAt(0);
            userId= user.ID;
            //if (query != null)
                exist = true;
            return exist;
            // accountDB.SelectBanks(user.ID);
        }
        public int get_userId()
        {
            return userId;
        }
    }
}
